package com.qf.handler;


import com.qf.Excaption.MyExcaption;
import com.qf.vo.ResultVO;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class Questhandler {
    @ExceptionHandler(Exception.class)
    public ResultVO Entry(Exception e){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(500);
        resultVO.setMsg("Exception"+e.getMessage());
        return resultVO;
    }
    @ExceptionHandler(MyExcaption.class)
    public ResultVO myExcaption(MyExcaption e){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(500);
        resultVO.setMsg("MyExcaption"+e.getMessage());
        return resultVO;
    }
}
